﻿/**
 *
 * @file FITKInterfaceHDF5AdaptorMaterial.h
 * @brief 读取HDF5文件的Material类
 * @author fulipeng (fulipengqd@yeah.net)
 * @date 2024-05-31
 *
 */
#ifndef  _FITKHDF5ADAPTORMATERIAL_H__
#define  _FITKHDF5ADAPTORMATERIAL_H__

#include "FITKAbaqusIOHDF5API.h"
#include "FITK_Kernel/FITKAdaptor/FITKIOAdaptorFactory.h"
#include "FITK_Interface/FITKInterfaceIOHDF5/FITKInterfaceHDF5AdaptorMaterial.h"

 //前置声明
ForwardDeclarNS(Interface, FITKAbstractMaterial)
ForwardDeclarNS(Interface, FITKAbaMaterial)
ForwardDeclarNS(Interface, FITKAbaMaterialDensity)
ForwardDeclarNS(Interface, FITKAbaMaterialElastic)
ForwardDeclarNS(Interface, FITKAbaMaterialPlastic)

namespace IO
{
    /**
     * @brief HDF5 Material 读写适配器
     * @author fulipeng (fulipengqd@yeah.net)
     * @date 2024-05-31
     */
    class FITKABAQUSIOHDF5API FITKAbaqusHDF5AdaptorMaterial : public FITKInterfaceHDF5AdaptorMaterial
    {
    public:
        explicit FITKAbaqusHDF5AdaptorMaterial() = default;
        virtual ~FITKAbaqusHDF5AdaptorMaterial() = default;

        /**
         * @brief 获取适配器数据类型名
         * @return 适配器数据类型名
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        QString getAdaptorClass() override;

        /**
         * @brief 适配器读取
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        bool adaptR() override;

        /**
         * @brief 适配器写出
         * @return 状态 true成功， false失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-31
         */
        bool adaptW() override;

    protected:

        /**
         * @brief 读取材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        virtual bool readMaterial(Interface::FITKAbstractMaterial* material, H5::Group & h5Group) override;

        /**
         * @brief 读取Density材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readDensity(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 读取Elastic材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readElastic(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 读取Plastic材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readPlastic(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 读取Hyperelastic(超弹性)材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readHyperelastic(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 读取Expansion(膨胀)材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-04
         */
        bool readExpansion(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 读取JohnsonCookDamage(损伤)材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-20
         */
        bool readJohnsonCookDamage(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 读取Damping(阻尼)材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-20
         */
        bool readDamping(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 写出材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-03
         */
        virtual bool writeMaterial(Interface::FITKAbstractMaterial* material, H5::Group & h5Group) override;

        /**
         * @brief 写出Density材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-20
         */
        bool writeDensity(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 写出Elastic材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-20
         */
        bool writeElastic(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 写出Plastic材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-20
         */
        bool writePlastic(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 写出Hyperelastic(超弹性)材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-20
         */
        bool writeHyperelastic(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 写出Expansion(膨胀)材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-20
         */
        bool writeExpansion(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 写出JohnsonCookDamage(损伤)材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-20
         */
        bool writeJohnsonCookDamage(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

        /**
         * @brief 写出Damping(阻尼)材料信息
         * @param material 抽象材料
         * @param h5Group 数据块
         * @return
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-06-20
         */
        bool writeDamping(Interface::FITKAbstractMaterial* material, H5::Group & h5Group);

    };

    Register2FITKIOAdaptorFactory(HDF5, Interface::FITKAbaMaterial, FITKAbaqusHDF5AdaptorMaterial)
}

#endif
